1. Field of the Invention
The present invention relates to, for example, a processing system for a portable electronic apparatus, the portable electronic apparatus, and a processing apparatus for the portable electronic apparatus all of which achieve various types of processing by transmitting and receiving commands.
2. Description of the Related Art
In general, an IC card used as a portable electronic apparatus includes a card-like main body formed of plastic or the like and an IC module embedded in the main body. The IC module includes an IC chip. The IC chip comprises a nonvolatile memory such as EEPROM (Electrically Erasable Programmable Read-Only Memory) or a flash ROM which can hold data even without a power supply, and CPU configured to perform various arithmetic operations.
The IC card offers high portability. The IC card can also communicate with an external apparatus. Moreover, the IC card can perform complicated arithmetic operations based on communicated data.
The IC card is characterized in that forging the IC card is difficult. For example, an IC card in which highly confidential information or the like is stored can be used for a security system or electronic commerce.
The above-described IC card stores various applications. Upon receiving a command from a reader and writer (card reader and writer) for the IC card through non-contact communication, the IC card executes an application corresponding to the received command. Thus, the IC card can achieve various functions.
However, when the IC card transmits and receives data to and from the card reader and writer, an error may occur in the data. That is, data transmitted by the transmitter fails to match data received by the receiver. Thus, for example, Japanese Patent No. 3607229 describes a portable electronic apparatus configured to add validation information to data to be transmitted.
The above-described portable electronic apparatus generates validation information from the characters in the data to be transmitted and adds the validation information to the transmission data. A processing apparatus for the IC card corresponding to a receiver generates the validation information from the characters in the received data. The processing apparatus then compares the received validation information with the generated validation information for validation. For example, IC cards conforming to the international standards ISO/IEC 14443 validate data using CRC or a hash.
The amount of data that can be transmitted during a single communication operation is predetermined. Thus, if a large amount of data needs to be transmitted, the IC card divides the data into a plurality of frames for transmission. The IC card generates validation information for each frame and adds the generated validation information to the transmission data.
Alternatively, the data stored in the IC card may itself be validated. In this case, data to which corresponding validation information is added behind the data is stored in the IC card. The validation information is generated based on pre-validated data. The IC card and the processing apparatus for the IC card generate validation information from the data and compare the generated validation information with the validation information added to the data for validation.
However, as described above, if the data transmitted by the IC card is too large to transmit during a single communication operation, the processing apparatus for the IC card receives the separated frames in order. Thus, disadvantageously, the processing apparatus for the IC card cannot determine whether or not validation information is present until the processing apparatus receives the frame containing the validation information.